package cn.tedu.csmall520.stock.webapi.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface StockMapper {

    @Insert("update stock_tbl set count=count-#{reduceCount} where commodity_code=#{commodityCode} and count>=#{reduceCount}")
    int update(@Param("commodityCode") String commodityCode,
               @Param("reduceCount") Integer reduceCount);
}
